home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / Batman.lha / Batman / Install < prev    next >
Text File  |  1998-06-30  |  3KB  |  137 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "Disk.1")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "Patcher")
  37. (P_chkrun)
  38.  
  39. (if
  40.   (= @user-level 2)
  41.   (
  42.     (set #CI_drive
  43.       (askchoice
  44.     (prompt "Select source drive for diskimages")
  45.     (default 0)
  46.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  47.     (help @askchoice-help)
  48.       )
  49.     )
  50.     (select #CI_drive
  51.       (set #CI_drive "DF0:")
  52.       (set #CI_drive "DF1:")
  53.       (set #CI_drive "DF2:")
  54.       (set #CI_drive "DF3:")
  55.     )
  56.   )
  57.   (set #CI_drive "DF0:")
  58. )
  59.  
  60. (set @default-dest
  61.   (askdir
  62.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  63.     (help @askdir-help)
  64.     (default @default-dest)
  65.     (disk)
  66.   )
  67. )
  68. (set #dest (tackon @default-dest @app-name))
  69. (if
  70.   (exists #dest)
  71.   (
  72.     (set #choice
  73.       (askbool
  74.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  75.         (default 1)
  76.         (choices "Delete" "Skip")
  77.         (help @askbool-help)
  78.       )
  79.     )
  80.     (if
  81.       (= #choice 1)
  82.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  83.     )
  84.   )
  85. )
  86. (makedir #dest
  87.   (help @makedir-help)
  88.   (infos)
  89. )
  90.  
  91. ;----------------------------
  92.  
  93. (copyfiles
  94.   (help @copyfiles-help)
  95.   (source ("%s.inf" @app-name ))
  96.   (newname ("%s.info" @app-name ))
  97.   (dest #dest)
  98. )
  99. (copyfiles
  100.   (help @copyfiles-help)
  101.   (source ("%s.slave" @app-name ))
  102.   (dest #dest)
  103. )
  104. (if
  105.   (exists #readme-file)
  106.   (copyfiles
  107.     (help @copyfiles-help)
  108.     (source #readme-file)
  109.     (dest #dest)
  110.   )
  111. )
  112. (if
  113.   (exists ("%s.info" #readme-file))
  114.   (copyfiles
  115.     (help @copyfiles-help)
  116.     (source ("%s.info" #readme-file))
  117.     (dest #dest)
  118.   )
  119. )
  120.  
  121. (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  122. (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  123. (run ("Assign \"%s:\" Remove" @app-name))
  124.  
  125. (if
  126.   (exists (tackon #dest #last-file))
  127.   ("")
  128.   (abort "Diskimaging not successful !\nThe Patcher could'nt create all needed files !")
  129. )
  130.  
  131. ;----------------------------
  132.  
  133. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  134.  
  135. (exit)
  136.  
  137.